home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interplay's Learn to Program Basic (Review Copy)
/
Learn to Program Basic Review Copy (Interplay)(June 23, 1998).ISO
/
pc
/
ltpbasic
/
refxmpl
/
cointoss.bas
< prev
next >
Wrap
BASIC Source File
|
1998-03-09
|
633b
|
45 lines
Dim A$ (2)
Data Heads, Tails
Let repeat = true
For I = 1 to 2
Read A$(I)
Next I
While repeat
choose:
CLS
Print "Call it! Select a number for your"
Print "choice on the coin-toss"
Print " 1. Heads"
Print " 2. Tails"
Input guess
If guess > 2 or guess < 1 then goto choose
Print "You have selected ";
Print A$(guess)
Let answer = Random (1,2)
Print "The toss is ";
sleep 20
Print A$(answer)
If guess=answer Then
Print "You win!"
Else Print "You lose!"
Endif
Print "Want to play again?"
Input answer$
If Left$(answer$,1) <> "y" Then
repeat = false
Endif
Wend
Print "Thanks for playing."
Print "Good-bye to you."
End